{include file="header.html"}
<script type="text/javascript">
    $.validator.addMethod('paymentType', function() {
        var payment_type = $('#payment_type').val();
        var bank_address = $('#bank_address').val();
        if(payment_type == '1' && bank_address == '')
        {
            return false;
        }
        else
        {
            return true;
        }

    }, '开户行不能为空');
    $(function(){
        $('#returns_form').validate({
            errorPlacement: function(error, element){
                $(element).next('.field_notice').hide();
                $(element).after(error);
            },
            success       : function(label){
                label.addClass('right').text('OK!');
            },
            onkeyup    : false,
            rules : {
                buyer_shipping_fee : {
                    required : true
                },
                phone : {
                    required : true
                },
                real_name : {
                    required : true
                },
                bank_card : {
                    required   : true
                },
                bank_address : {
                    paymentType   : true
                }
            },
            messages : {
                buyer_shipping_fee : {
                    required : '退货运费不能为空'
                },
                phone : {
                    required : '联系电话不能为空'
                },
                real_name : {
                    required : '账户姓名不能为空'
                },
                bank_card  : {
                    required   : '账号不能为空'
                },
                bank_address : {
                    paymentType: '开户行不能为空'
                }
            }
        });
    });
</script>
<div id="rightTop">
  <p>退货/退款管理</p>
  <ul class="subnav">
    <li>
      <a class="btn1" href="index.php?app=returns">退款管理</a>
    </li>
    <li>
      <span>添加退货运费</span>
    </li>
  </ul>
</div>
<div class="info">
  <form method="post" id="returns_form">
    <table class="infoTable">
      <tr>
        <th class="paddingT15">退货编号:</th>
        <td class="paddingT15 wordSpacing5">
            {$returns.returns_sn}
        </td>
      </tr>
       <tr>
        <th class="paddingT15">订单号:</th>
        <td class="paddingT15 wordSpacing5">
            {$returns.order_sn}
        </td>
      </tr>
        <tr>
            <th class="paddingT15"><span style="color:red;">*</span> 退货运费:</th>
            <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" type="text" name="buyer_shipping_fee"  onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" value="{$returns.buyer_shipping_fee}" />
            </td>
        </tr>
        <tr>
            <th class="paddingT15"><span style="color:red;">*</span> 联系电话:</th>
            <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" type="text" name="phone"  onkeyup="this.value=this.value.replace(/[^0-9-\s]/g,'')" value="{$returns.buyer_shipping_fee}" />
            </td>
        </tr>
        <tr>
            <th class="paddingT15"><span style="color:red;">*</span> 账户姓名:</th>
            <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" type="text" name="real_name"  value="{$returns.real_name}" />
            </td>
        </tr>
        <tr>
            <th class="paddingT15"><span style="color:red;">*</span> 账号:</th>
            <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" type="text" name="bank_card" value="{$returns.bank_card}" />
            </td>
        </tr>
      <tr>
        <th class="paddingT15">账号类型:</th>
        <td class="paddingT15 wordSpacing5">
          <select class="querySelect" name="payment_type" id="payment_type">
            {html_options options=$payment_type selected=$returns.payment_type}
          </select>
        </td>
      </tr>
        <tr>
            <th class="paddingT15">开户行:</th>
            <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" type="text" name="bank_address" id="bank_address" value="{$returns.bank_address}" /> <span style="color: #666;">如果是账号类型是网银请填写开户行</span>
            </td>
        </tr>
        <tr>
            <th class="paddingT15">身份证:</th>
            <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" type="text" name="identity_card" value="{$returns.identity_card}" />
            </td>
        </tr>

      <tr>
        <th></th>
        <td class="ptb20">
          <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
          <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
          <input class="formbtn" type="button" onclick="javascript:history.back();" value="返回" />
        </td>
      </tr>
    </table>
  </form>
</div>
{include file="footer.html"}